{% load i18n %}

{% block errors %}
    <hr class="dark:border-gray-800 my-8">

    <ul>
        {% for error in result.base_errors  %}
            <li>
                {{ error.error }}

                <div class="traceback">{{ error.traceback|linebreaks }}</div></li>
        {% endfor %}

        {% for line, errors in result.row_errors %}
            {% for error in errors %}
                <li x-data="{ open: false }">
                    <div class="bg-red-50 border border-red-200 cursor-pointer mb-4 rounded shadow-sm text-red-500 dark:bg-red-500/20 dark:border-red-500/20" x-on:click="open = ! open">
                        <div class="border-b border-red-200 flex flex-row font-semibold py-3 px-4 dark:border-red-500/20">
                            {% trans "Line number" %}: {{ line }} - {{ error.error }}
                        </div>

                        <div class="px-4 py-3">
                            <code>
                                {{ error.row.values|join:", " }}
                            </code>
                        </div>
                    </div>

                    <div class="block border leading-relaxed mb-4 rounded p-4 traceback dark:border-gray-800 dark:text-font-default-dark " x-show="open">
                        {{ error.traceback|linebreaks }}
                    </div>
                </li>
            {% endfor %}
        {% endfor %}
    </ul>
{% endblock %}
